import tkinter as tk

root = tk.Tk()
root.title("@_@")
root.geometry("145x45")
root.resizable(False, False)

n_second = 10 * 60
remaining = n_second
timer_index = 0

var = tk.StringVar()
def remaining_str():
    global remaining
    return "%02d:%02d" % divmod(remaining, 60)

def timer_tick(index):
    global remaining
    global timer_index

    if index != timer_index: return

    remaining -= 1
    var.set(remaining_str())
    if remaining > 0:
        root.after(1000, timer_tick, index)
    else:
        root.wm_attributes("-fullscreen", True)

def timer_start():
    global n_second
    global remaining
    global timer_index

    remaining = n_second
    var.set(remaining_str())
    timer_index += 1
    root.after(1000, timer_tick, timer_index)
    root.wm_attributes("-fullscreen", False)

frame = tk.Frame(root)

label = tk.Label(frame, textvariable=var, font=("New Courier", 28), width=6)
var.set(remaining_str())
label.pack(side="left")

button = tk.Button(frame, text="↻", command=timer_start)
button.pack(side="right")

# frame.pack()
frame.place(relx=0.5, rely=0.5, anchor="center", height=45, width=150)
#print(var.get())

#root.overrideredirect(True)
root.wm_attributes("-alpha", 0.5)
root.wm_attributes("-toolwindow", True)
root.wm_attributes("-topmost", True)

timer_start()

root.mainloop()
